<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>主</title>
<import type='css' file="css.main" />
<load href="__PUBLIC__/js/jquery-1.9.1.min.js" />
<import type='js' file="js.main" />
	<style type="text/css">
		body{font-size: 14px;}
		h1.infotitle{display: block; text-align: center; line-height: 36px; clear: both; overflow: hidden; margin-top: 60px; font-weight: normal; font-size: 32px;}
		.awardw{width: 80%; margin: 0px auto;}
		.tableinfo{width: 100%; clear: both; margin-top: 50px;}
		table{border-collapse:collapse; border: solid 1px #ebebeb; border-color: #ebebeb;}
		table th{height: 40px; line-height: 40px; background-color: #00A388; color: #fff; font-weight: normal; font-size: 16px;}
		table tr td{text-align: center; padding: 20px 10px;}
		.awardresult{line-height: 32px; clear: both; margin-top: 20px; font-size: 16px;}
		.awardresult select{height: 25px; line-height: 25px; border-radius: 5px;}
		.awardresult select option{line-height: 25px;}
		a.setstatus{text-align: center; color: #fff; cursor: pointer; background-color: #ff5454; padding: 4px 15px; border-radius:5px;}

		select.setaward{height: 25px; line-height: 25px; border-radius: 5px;}
		select.setaward option{line-height: 25px;}
		input.awardtime{text-align: center; width: 80%; border: solid 1px #ccc; border-radius: 5px; height: 30px; line-height: 30px; background-color: #fff; font-size: 14px;}
	</style>
</head>

<body>
<div class="awardw">
	<h1 class="infotitle">开奖时间设置</h1>
	<div class="tableinfo">
		<table width="100%" border="1" cellspacing="0" cellpadding="0" class="indextable">
			<tr>
				<th width="25%">奖品名称</th>
				<th width="10%">奖品数量</th>
				<th width="25%">抽奖时间</th>
				<th width="10%">操作</th>
			</tr>
			<volist name="awardlist" id="v">
			<tr>
				<td>{$v['awardname']}</td>
				<td>{$v['awardnum']}</td>
				<td><input type="text" class="awardtime" name="awardtime" value="{:W('Jgward/getawardtime',array('id'=>$v['id'],'field'=>'awardtime'))}" /></td>
				<td class="caozuo"><a class="setstatus" v="{$v['id']}">修改</a></td>
			</tr>
			</volist>
		</table>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$(".setstatus").each(function(index,element){
			var t = $(this);
			t.click(function(){
				var id = $(this).attr('v');
				var awardtime = $(".awardtime:eq("+index+")").val();
				if(id!=''){
					var savetel_url = "{:U('changetime')}";
					var teldata = {"id":id,"awardtime":awardtime,random:Math.random()};
					$.ajax({
						url:savetel_url,
						data:teldata,
						type:"POST",
						dataType:"JSON",
						success:function (data){
							if(data.ret==1){
								location.reload();
							}else{
								alert('修改失败，请重新再次修改');
								location.reload();
							}
						}
					});
				}
			})
		})
	})
</script>
</body>
</html>
